package com.erp.account.dao.idl;

import java.util.Map;
import java.util.Set;
import java.util.Vector;

import com.erp.account.ao.idl.AccountPo.ContactFilterPo;
import com.erp.account.ao.idl.AccountPo.ContactPo;
import com.erp.account.ao.idl.AccountPo.CustomerCreditPo;
import com.erp.account.ao.idl.AccountPo.EmployeeFilterPo;
import com.erp.account.ao.idl.AccountPo.EmployeePo;
import com.erp.account.dao.idl.AccountDdo.BusinessUnitsDdo;
import com.erp.account.dao.idl.AccountDdo.BusinessUnitsFilterDdo;
import com.paipai.lang.uint32_t;
import com.paipai.lang.uint64_t;
import com.paipai.util.annotation.ApiProtocol;
import com.paipai.util.annotation.Field;
import com.paipai.util.annotation.HeadApiProtocol;

/**
 * 云ERP账户系统dao
 * 
 * @author blucelu
 * @version 1.0, 2013-10-14
 * 
 */

@HeadApiProtocol(cPlusNamespace = "erp::account::dao", needInit = true, needReset = true, serviceType="dao", platformType="erp")
public class AccountDao
{
	@ApiProtocol(cmdid = "0xc0381801L", desc = "添加/修改来往单位；传入来往单位SysNo不为0时则进行修改，反之则进行添加；")
	class ModifyBusinessUnits
	{
		class Req
		{
			@Field(desc = "机器码，必填 ")
			String machineKey;

			@Field(desc = "调用来源，必填 ")
			String source;

			@Field(desc = "场景ID，必填 ")
			uint32_t sceneId;
			
			@Field(desc = "功能选项，扩展选填 ")
			uint32_t option;
			
			@Field(desc = "分支机构PO，必填 ")
			BusinessUnitsDdo businessUnitsDdo;

			@Field(desc = "请求保留字 ")
			String inReserve;
		}

		class Resp
		{
			@Field(desc = "错误信息 ")
			String errmsg;
			
			@Field(desc = "返回相应的SysNo ")
			uint64_t SysNo;	
			
			@Field(desc = "返回保留字  ")
			String outReserve;
		}
	};

	@ApiProtocol(cmdid = "0xc0381802L", desc = "删除来往单位（逻辑）")
	class DeleteBusinessUnits
	{
		class Req
		{
			@Field(desc = "机器码，必填 ")
			String machineKey;

			@Field(desc = "调用来源，必填 ")
			String source;

			@Field(desc = "场景ID，必填 ")
			uint32_t sceneId;
			
			@Field(desc = "功能选项，扩展选填 ")
			uint32_t option;
			
			@Field(desc = "需删除的来往单位的SysNo，必填 ")
			uint64_t businessUnitsSysNo;

			@Field(desc = "请求保留字 ")
			String inReserve;
		}

		class Resp
		{
			@Field(desc = "错误信息 ")
			String errmsg;

			@Field(desc = "返回保留字  ")
			String outReserve;
		}
	};
	
	@ApiProtocol(cmdid = "0xc0381803L", desc = "根据分支机构ID批量获取分支机构信息")
	class GetBusinessUnitsByIds
	{
		class Req
		{
			@Field(desc = "机器码，必填 ")
			String machineKey;

			@Field(desc = "调用来源，必填 ")
			String source;

			@Field(desc = "场景ID，必填 ")
			uint32_t sceneId;
			
			@Field(desc = "功能选项，扩展选填 ")
			uint32_t option;
			
			@Field(desc = "需获取的来往单位的SysNo，必填 ")
			Set<uint64_t> businessUnitsSysNos;

			@Field(desc = "请求保留字 ")
			String inReserve;
		}

		class Resp
		{
			@Field(desc = "错误信息 ")
			String errmsg;
			
			@Field(desc = "获取失败的错误码")
			Map<uint64_t,uint32_t> errorCode;
			
			@Field(desc = "获取失败的错误信息")
			Map<uint64_t,String> errorMsg;
			
			@Field(desc = "获取成功的来往单位信息")
			Map<uint64_t,BusinessUnitsDdo> businessUnitsDdo;
			
			@Field(desc = "返回保留字  ")
			String outReserve;
		}
	};
	
	@ApiProtocol(cmdid = "0xc0381804L", desc = "根据过滤条件查询来往单位列表信息")
	class GetBusinessUnitsByFilter
	{
		class Req
		{
			@Field(desc = "机器码，必填 ")
			String machineKey;

			@Field(desc = "调用来源，必填 ")
			String source;

			@Field(desc = "场景ID，必填 ")
			uint32_t sceneId;
			
			@Field(desc = "功能选项，扩展选填 ")
			uint32_t option;
			
			@Field(desc = "过滤器，必填 ")
			BusinessUnitsFilterDdo filter;

			@Field(desc = "请求保留字 ")
			String inReserve;
		}

		class Resp
		{
			@Field(desc = "错误信息 ")
			String errmsg;
			
			@Field(desc = "分支机构总数")
			uint32_t total;
			
			@Field(desc = "分支机构列表信息")
			Vector<BusinessUnitsDdo> businessUnitsDdo;
			
			@Field(desc = "返回保留字  ")
			String outReserve;
		}
	};
	
	@ApiProtocol(cmdid = "0xc0381805L", desc = "添加/修改职员；传入来往单位SysNo不为0时则进行修改，反之则进行添加；")
	class ModifyEmployee
	{
		class Req
		{
			@Field(desc = "机器码，必填 ")
			String machineKey;

			@Field(desc = "调用来源，必填 ")
			String source;

			@Field(desc = "场景ID，必填 ")
			uint32_t sceneId;
			
			@Field(desc = "功能选项，扩展选填 ")
			uint32_t option;
			
			@Field(desc = "职员PO，必填 ")
			EmployeePo employeePo;

			@Field(desc = "请求保留字 ")
			String inReserve;
		}

		class Resp
		{
			@Field(desc = "错误信息 ")
			String errmsg;

			@Field(desc = "返回相应的SysNo ")
			uint64_t SysNo;	
			
			@Field(desc = "返回保留字  ")
			String outReserve;
		}
	};

	@ApiProtocol(cmdid = "0xc0381806L", desc = "删除职员（逻辑）")
	class DeleteEmployee
	{
		class Req
		{
			@Field(desc = "机器码，必填 ")
			String machineKey;

			@Field(desc = "调用来源，必填 ")
			String source;

			@Field(desc = "场景ID，必填 ")
			uint32_t sceneId;
			
			@Field(desc = "功能选项，扩展选填 ")
			uint32_t option;
			
			@Field(desc = "需删除的职员的SysNo，必填 ")
			uint64_t employeeSysNo;

			@Field(desc = "请求保留字 ")
			String inReserve;
		}

		class Resp
		{
			@Field(desc = "错误信息 ")
			String errmsg;

			@Field(desc = "返回保留字  ")
			String outReserve;
		}
	};
	
	@ApiProtocol(cmdid = "0xc0381807L", desc = "根据职员ID批量获取职员信息")
	class GetEmployeeByIds
	{
		class Req
		{
			@Field(desc = "机器码，必填 ")
			String machineKey;

			@Field(desc = "调用来源，必填 ")
			String source;

			@Field(desc = "场景ID，必填 ")
			uint32_t sceneId;
			
			@Field(desc = "功能选项，扩展选填 ")
			uint32_t option;
			
			@Field(desc = "需获取的职员的SysNo，必填 ")
			Set<uint64_t> employeeSysNo;

			@Field(desc = "请求保留字 ")
			String inReserve;
		}

		class Resp
		{
			@Field(desc = "错误信息 ")
			String errmsg;
			
			@Field(desc = "获取失败的错误码")
			Map<uint64_t,uint32_t> errorCode;
			
			@Field(desc = "获取失败的错误信息")
			Map<uint64_t,String> errorMsg;
			
			@Field(desc = "获取成功的来往单位信息")
			Map<uint64_t,EmployeePo> employeePo;
			
			@Field(desc = "返回保留字  ")
			String outReserve;
		}
	};
	
	@ApiProtocol(cmdid = "0xc0381808L", desc = "根据过滤条件查询职员列表信息")
	class GetEmployeeByFilter
	{
		class Req
		{
			@Field(desc = "机器码，必填 ")
			String machineKey;

			@Field(desc = "调用来源，必填 ")
			String source;

			@Field(desc = "场景ID，必填 ")
			uint32_t sceneId;
			
			@Field(desc = "功能选项，扩展选填 ")
			uint32_t option;
			
			@Field(desc = "过滤器，必填 ")
			EmployeeFilterPo filter;

			@Field(desc = "请求保留字 ")
			String inReserve;
		}

		class Resp
		{
			@Field(desc = "错误信息 ")
			String errmsg;
			
			@Field(desc = "职员总数")
			uint32_t total;
			
			@Field(desc = "职员列表信息")
			Vector<EmployeePo> businessUnitsPo;
			
			@Field(desc = "返回保留字  ")
			String outReserve;
		}
	};
	
	@ApiProtocol(cmdid = "0xc0381809L", desc = "根据主键查询信用额度")
	class GetCustomerCredit
	{
		class Req
		{
			@Field(desc = "机器码，必填 ")
			String machineKey;

			@Field(desc = "调用来源，必填 ")
			String source;

			@Field(desc = "场景ID，必填 ")
			uint32_t sceneId;
			
			@Field(desc = "功能选项，扩展选填 ")
			uint32_t option;
			
			@Field(desc = "分支机构SysNo，必填 ")
			uint64_t branchSysNo;
			
			@Field(desc = "往来单位SysNo，必填 ")
			uint64_t businessUnitsSysNo;
			
			@Field(desc = "请求保留字 ")
			String inReserve;
		}

		class Resp
		{
			@Field(desc = "错误信息 ")
			String errmsg;

			@Field(desc = "信用额度信息")
			CustomerCreditPo customerCreditPo;
			
			@Field(desc = "返回保留字  ")
			String outReserve;
		}
	};
	
	@ApiProtocol(cmdid = "0xc038180aL", desc = "添加/修改信用额度；传入组合主键往来单位SysNo和分支机构SysNo")
	class ModifyCustomerCredit
	{
		class Req
		{
			@Field(desc = "机器码，必填 ")
			String machineKey;

			@Field(desc = "调用来源，必填 ")
			String source;

			@Field(desc = "场景ID，必填 ")
			uint32_t sceneId;
			
			@Field(desc = "功能选项，扩展选填 ")
			uint32_t option;
			
			@Field(desc = "职员PO，必填 ")
			CustomerCreditPo customerCreditPo;

			@Field(desc = "请求保留字 ")
			String inReserve;
		}

		class Resp
		{
			@Field(desc = "错误信息 ")
			String errmsg;
			
			@Field(desc = "返回保留字  ")
			String outReserve;
		}
	};
	
	@ApiProtocol(cmdid = "0xc038180bL", desc = "添加/修改联系人；传入联系人SysNo不为0时则进行修改，反之则进行添加；")
	class ModifyContact
	{
		class Req
		{
			@Field(desc = "机器码，必填 ")
			String machineKey;

			@Field(desc = "调用来源，必填 ")
			String source;

			@Field(desc = "场景ID，必填 ")
			uint32_t sceneId;
			
			@Field(desc = "功能选项，扩展选填 ")
			uint32_t option;
			
			@Field(desc = "分支机构PO，必填 ")
			ContactPo contactPo;

			@Field(desc = "请求保留字 ")
			String inReserve;
		}

		class Resp
		{
			@Field(desc = "错误信息 ")
			String errmsg;

			@Field(desc = "返回相应的SysNo ")
			uint64_t SysNo;	
			
			@Field(desc = "返回保留字  ")
			String outReserve;
		}
	};

	@ApiProtocol(cmdid = "0xc038180cL", desc = "删除联系人（逻辑）")
	class DeleteContact
	{
		class Req
		{
			@Field(desc = "机器码，必填 ")
			String machineKey;

			@Field(desc = "调用来源，必填 ")
			String source;

			@Field(desc = "场景ID，必填 ")
			uint32_t sceneId;
			
			@Field(desc = "功能选项，扩展选填 ")
			uint32_t option;
			
			@Field(desc = "需删除的联系人的SysNo，必填 ")
			uint64_t contactSysNo;

			@Field(desc = "请求保留字 ")
			String inReserve;
		}

		class Resp
		{
			@Field(desc = "错误信息 ")
			String errmsg;

			@Field(desc = "返回保留字  ")
			String outReserve;
		}
	};
	
	@ApiProtocol(cmdid = "0xc038180dL", desc = "根据联系人SysNo批量获取联系人信息")
	class GetContactByIds
	{
		class Req
		{
			@Field(desc = "机器码，必填 ")
			String machineKey;

			@Field(desc = "调用来源，必填 ")
			String source;

			@Field(desc = "场景ID，必填 ")
			uint32_t sceneId;
			
			@Field(desc = "功能选项，扩展选填 ")
			uint32_t option;
			
			@Field(desc = "需获取的联系人的SysNo，必填 ")
			Set<uint64_t> contactSysNo;

			@Field(desc = "请求保留字 ")
			String inReserve;
		}

		class Resp
		{
			@Field(desc = "错误信息 ")
			String errmsg;
			
			@Field(desc = "获取失败的错误码")
			Map<uint64_t,uint32_t> errorCode;
			
			@Field(desc = "获取失败的错误信息")
			Map<uint64_t,String> errorMsg;
			
			@Field(desc = "获取成功的来往单位信息")
			Map<uint64_t,ContactPo> contactPo;
			
			@Field(desc = "返回保留字  ")
			String outReserve;
		}
	};
	
	@ApiProtocol(cmdid = "0xc038180eL", desc = "根据过滤条件查询联系人信息")
	class GetContactByFilter
	{
		class Req
		{
			@Field(desc = "机器码，必填 ")
			String machineKey;

			@Field(desc = "调用来源，必填 ")
			String source;

			@Field(desc = "场景ID，必填 ")
			uint32_t sceneId;
			
			@Field(desc = "功能选项，扩展选填 ")
			uint32_t option;
			
			@Field(desc = "过滤器，必填 ")
			ContactFilterPo filter;

			@Field(desc = "请求保留字 ")
			String inReserve;
		}

		class Resp
		{
			@Field(desc = "错误信息 ")
			String errmsg;
			
			@Field(desc = "分支机构总数")
			uint32_t total;
			
			@Field(desc = "分支机构列表信息")
			Vector<ContactPo> contactPo;
			
			@Field(desc = "返回保留字  ")
			String outReserve;
		}
	};
}
